<html>
<head><meta charset="utf-8"><title>OpenBSD docker image for docs.rs · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html">OpenBSD docker image for docs.rs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246517512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246517512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246517512">(Jul 19 2021 at 21:24)</a>:</h4>
<p>Hi, not sure if this is the right place to ask. I'm working on a couple system crates for OpenBSD, and the <a href="http://docs.rs">docs.rs</a> builds fail because they aren't meant to be built on Linux. Does the <a href="https://github.com/rust-lang/crates-build-env">crates-build-env</a> repository accept PRs for new docker images?</p>



<a name="246523800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246523800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246523800">(Jul 19 2021 at 22:34)</a>:</h4>
<p><span class="user-mention" data-user-id="426841">@orvi</span> do you mean "are only meant to build on Linux"? <a href="http://Docs.rs">Docs.rs</a> is only supported on x86_64-unknown-linux-gnu</p>



<a name="246523826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246523826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246523826">(Jul 19 2021 at 22:34)</a>:</h4>
<p>And fixing it isn't simple, you'd need to extend rustwide to support cross compiling to a different host</p>



<a name="246523840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246523840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246523840">(Jul 19 2021 at 22:34)</a>:</h4>
<p>Or something like that, I forget exactly the bug</p>



<a name="246524248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524248">(Jul 19 2021 at 22:40)</a>:</h4>
<p><span class="user-mention" data-user-id="426841">@orvi</span> If you're writing an OpenBSD-only crate, you may want to allow at least <em>documenting</em> it on a non-OpenBSD target. You could do that by using <code>cfg(doc)</code>.</p>



<a name="246524301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524301">(Jul 19 2021 at 22:41)</a>:</h4>
<p>But also, note that while the build requires that the <em>host</em> is Linux, you can use a different <em>target</em>.</p>



<a name="246524305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524305">(Jul 19 2021 at 22:41)</a>:</h4>
<p>See <a href="https://docs.rs/about/metadata">https://docs.rs/about/metadata</a></p>



<a name="246524311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524311">(Jul 19 2021 at 22:41)</a>:</h4>
<p>Oh oh I misunderstood, the crate itself is BSD-only. Does it support being cross compiled? That's the easiest way to fix this</p>



<a name="246524319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524319">(Jul 19 2021 at 22:41)</a>:</h4>
<p>"Any target supported by rustup can be used"</p>



<a name="246524447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524447">(Jul 19 2021 at 22:43)</a>:</h4>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[package.metadata.docs.rs]</span>
<span class="n">default-target</span> <span class="o">=</span> <span class="s">"x86_64-unknown-openbsd"</span>
<span class="n">targets</span> <span class="o">=</span> <span class="k">["x86_64-unknown-openbsd"]</span>
</code></pre></div>



<a name="246524460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524460">(Jul 19 2021 at 22:43)</a>:</h4>
<p>/me is very proud of implementing support for arbitrary targets</p>



<a name="246524467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524467">(Jul 19 2021 at 22:43)</a>:</h4>
<p>As long as you can cross-compile, the above snippet should work.</p>



<a name="246524476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524476">(Jul 19 2021 at 22:43)</a>:</h4>
<p>(You might not need to set <code>default-target</code>, since it sounds like it defaults to the first element of <code>targets</code>.)</p>



<a name="246524556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246524556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246524556">(Jul 19 2021 at 22:44)</a>:</h4>
<p>Yeah ideally we wouldn't have both but default-target existed a while before <code>targets</code> did.</p>



<a name="246542090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246542090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246542090">(Jul 20 2021 at 03:48)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> awesome! So much easier than spinning up a new docker image. This is what I was looking for, thank you very much</p>



<a name="246542686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246542686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246542686">(Jul 20 2021 at 04:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers/near/246524467">said</a>:</p>
<blockquote>
<p>As long as you can cross-compile, the above snippet should work.</p>
</blockquote>
<p>May still have an issue, the crates are system libraries (depend on system headers not found in Linux) :(</p>



<a name="246548224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246548224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246548224">(Jul 20 2021 at 06:06)</a>:</h4>
<p>That's harder, but doable in a few ways.</p>



<a name="246548248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246548248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246548248">(Jul 20 2021 at 06:07)</a>:</h4>
<p>Do you actually need C headers (e.g. because you're using bindgen) or could you just declare <code>extern "C"</code> functions for the library?</p>



<a name="246548311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246548311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246548311">(Jul 20 2021 at 06:08)</a>:</h4>
<p>If the latter, then you may be interested in helping with the "raw-dylib" support, which would do exactly what you want.</p>



<a name="246635483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246635483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246635483">(Jul 20 2021 at 19:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers/near/246548248">said</a>:</p>
<blockquote>
<p>Do you actually need C headers (e.g. because you're using bindgen) or could you just declare <code>extern "C"</code> functions for the library?</p>
</blockquote>
<p>I'm using bindgen with C headers, but ended up declaring structs and <code>extern "C"</code> functions for non-OpenBSD builds (maybe it makes sense to just use the manual declarations, idk)</p>



<a name="246635603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246635603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246635603">(Jul 20 2021 at 19:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers/near/246548311">said</a>:</p>
<blockquote>
<p>If the latter, then you may be interested in helping with the "raw-dylib" support, which would do exactly what you want.</p>
</blockquote>
<p>I haven't heard of "raw-dylib", I'll look into it. Happy to help if I can</p>



<a name="246636034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246636034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246636034">(Jul 20 2021 at 19:16)</a>:</h4>
<p><span class="user-mention" data-user-id="426841">@orvi</span> raw-dylib makes it possible to build a crate that links against a shared library, without having that shared library present on the system.</p>



<a name="246636094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246636094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246636094">(Jul 20 2021 at 19:17)</a>:</h4>
<p>So, for instance, raw-dylib would allow cross-compiling the libc crate for OpenBSD without having the library or headers of OpenBSD libc available.</p>



<a name="246636118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246636118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246636118">(Jul 20 2021 at 19:17)</a>:</h4>
<p><em>Huge</em> win for the ease of cross-compilation.</p>



<a name="246636538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246636538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246636538">(Jul 20 2021 at 19:21)</a>:</h4>
<p>that sounds awesome, and would definitely drop the need for the manual work I'm doing now. Is is part of rustc?</p>



<a name="246637213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246637213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246637213">(Jul 20 2021 at 19:27)</a>:</h4>
<p>Basic support is implemented for windows afaik.</p>



<a name="246637818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/OpenBSD%20docker%20image%20for%20docs.rs/near/246637818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> orvi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/OpenBSD.20docker.20image.20for.20docs.2Ers.html#246637818">(Jul 20 2021 at 19:32)</a>:</h4>
<p>ok, I'm reading through the tracking issue now</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>